

import os

from flask import Flask
from flask.ext.login import LoginManager


TEMPLATE_PATH = os.path.join("app", "views")
STATIC_FOLDER_PATH = os.path.join(os.path.dirname(os.path.abspath(__name__)), "app")

app = Flask(__name__, template_folder=TEMPLATE_PATH,
            static_folder=STATIC_FOLDER_PATH,
            static_url_path="")


# app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
#   '/': os.path.join(os.path.dirname(__file__), 'app')
# })


app.config['UPLOAD_FOLDER'] = os.getcwd() #tempfile.gettempdir()
app.secret_key = "3&\xfe%\x08\x14\xf1\xcf\xba\xdci\xeb\x08\x10\xac\x1af\xb1\xd7\x07(j\xfb\x17"

login_mgr = LoginManager(app)
login_mgr.init_app(app)


print "app root path", app.root_path

